package com.bktech.stupidnews.controlpanel;

import java.util.ArrayList;

public class Category {

	public ArrayList<ChildCategory> listChild;
	public String name;
	public boolean expand;

	public enum TYPE {
		BUTTON_HOME, CATEGORY, BUTTON_ADD , BUTTON_EDIT
	}

	private TYPE type;

	public Category(TYPE type, String name) {
		this.type = type;
		this.name = name;
		if (type == TYPE.CATEGORY) {
			listChild = new ArrayList<ChildCategory>();
		}
		this.expand = false;
	}

	public TYPE getType() {
		return this.type;
	}

	public void remove(ChildCategory rss) {
		listChild.remove(rss);
	}

	public void add(ChildCategory rss) {
		listChild.add(rss);
	}

	public void moveRSSToCategory(Category desCategory, ChildCategory rss) {
		ChildCategory rssTempority = rss;
		this.remove(rss);
		desCategory.add(rssTempority);
	}

	public ChildCategory getChild(int pos) {
		return listChild.get(pos);
	}

}
